<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head lang="en">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta name="format-detection" content="email=no"/>
    <meta charset="UTF-8">
    <script type="text/javascript" th:src="@{${session.baseUrl}+'js/common.js'}"></script>
    <script th:src="@{${session.baseUrl}+'js/jquery.js'}"></script>
    <link th:href="@{${session.baseUrl}+'style/reset.css'}" rel="stylesheet" type="text/css">
    <link th:href="@{${session.baseUrl}+'style/base.css'}" rel="stylesheet" type="text/css">
    <link th:href="@{${session.baseUrl}+'style/header.css'}" rel="stylesheet" type="text/css">
    <link rel="stylesheet" th:href="@{${session.baseUrl}+'style/myProject.css'}"/>
    <link rel="stylesheet" th:href="@{${session.baseUrl}+'style/transfer.css'}"/>
    <title>我的推广</title>
    <style>
        .sspan{
            overflow: hidden;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
            white-space:nowrap;
            width:4rem;
            display:block;

        }
    </style>
</head>
<body>
<header><span onclick="javascript:history.go(-1)"></span>我的推广</header>
<nav>
    <a th:href="@{/dividendRecord/search2.html}">
        <div>搜索用户名称</div>
    </a>
</nav>
<p>&nbsp;</p>
<span id="content0" >

    <ul class="content"  th:each="dend,iterStat:${dividendRecordList}">
            <li >

                <div class="container">
                    <!--<img th:src="@{${session.baseUrl}+'images/myProject/img1.png'}" alt="" class="banner"/>-->
                    <p class="intro" style=" padding-left: 0.1rem; display:inline-block;overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" th:text="${dend.inviteeName}"></p>
                </div>
                <div class="message" style="height: 1rem;">
                    <div style="padding-left: 0.3rem;">
                        <div class="f22 g9" style="width: 4rem;">项目名称：<br><span class="f26 sspan" th:text="${dend.projectName}"></span></div>
                    </div>
                    <div style="padding-right: 0.7rem">
                        <div class="f22 g9" >购买金额：<br><span class="f26 money"  th:text="${dend.money}"></span></div>
                    </div>
                </div>

                    <div class="message" style="height: 1rem;">
                    <div style="padding-left: 0.3rem;">
                        <div class="f22 g9">购买时间：<br><span class="f26 " th:text="${#dates.format(dend.createTime, 'yyyy-MM-dd')}"></span></div>
                    </div>
                    <div style="padding-right: 0.7rem;transform: translate(-0.5rem, 0rem);">
                        <div class="f22 g9" >分红：<br><span class="f26 money" th:text="${dend.dividend}"></span></div>
                    </div>

                </div>

            </li>
        <li><p>&nbsp;</p></li>


    </ul>
    <div th:if="${dividendRecordList==null || dividendRecordList.size()==0}">
    <img th:src="@{${session.baseUrl}+'\images\zanwu.png'}" style="width: 8.5rem;height:5.2rem;transform: translate(0rem, 0rem);"/>
</div>
</span>


<script type="text/javascript" th:inline="javascript">


    var basePath = /*[[${#httpServletRequest.getScheme() + "://" + #httpServletRequest.getServerName() + ":" + #httpServletRequest.getServerPort() + #httpServletRequest.getContextPath()}]]*/;


    var num = 1;
    $(function () {
        $(window).scroll(
            function () {

                if ((document.documentElement.scrollHeight) == (document.documentElement.scrollTop | document.body.scrollTop) + document.documentElement.clientHeight) {
                    num = num + 1;

                    $.ajax({
                        type: "POST",
                        data: {
                            current: num,
                            memberId:/*[[${session.memberId}]]*/,
                        },
                        url: basePath + '/dividendRecord/pageList1',
                        cache: false,
                        /*async:true,    //true：异步，false：同步。*/
                        success: function (data) {

                            str = '';
                            $.each(data, function (index, value) {
                                console.log(value);
                                str +='<ul class="content">';
                                str += '<li>';

                                str += '<div class="container">';
                                str += '<p class="intro" style=" padding-left: 0.1rem; display:inline-block;overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" >&nbsp;' + value.inviteeName + '</p>';
                                str += '</div>';
                                str += '<div class="message" style="height: 1rem;">';
                                str += '<div style="padding-left: 0.3rem;">';
                                str += ' <div class="f22 g9" style="width: 4rem;">项目名称：<br><span class="f26 sspan" >' + value.projectName + '</span></div>';
                                str += '</div>';

                                str += '<div>';
                                str += '<div class="f22 g9" style="padding-right: 0.7rem">购买金额：<br><span class="f26 money">' + value.moneyStr + '</span></div>';
                                str += '</div>';
                                str += '</div>';
                                str +='<div class="message" style="height: 1rem;">';
                                str += '<div style="padding-left: 0.3rem;">';
                                str += ' <div class="f22 g9">购买时间：<br><span class="f26 " >' + value.createTimeStr + '</span></div>';
                                str += '</div>';

                                str += '<div style="padding-right: 0.7rem;transform: translate(-0.5rem, 0rem);">';
                                str += '<div class="f22 g9">分红：<br><span class="f26 money">' + value.dividendStr + '</span></div>';
                                str += '</div>';
                                str += '</div>';
                                str += '</div>';
                                str += '</li>';
                                str +='<li><p>&nbsp;</p></li>';
                                str +='</ul>'
                            });
                            $("#content0").append(str); //动态加载插入HTML
                        },
                        error: function () {
                            alert("ajax请求失败");
                        }
                    })


                }
            });
    });


</script>
</body>
</html>